/*
 * Copyright (c) 2023, 2024,yzc.cn All rights reserved.
 *
 */
package cn.yzc.controller;

import cn.yzc.entity.Orders;
import cn.yzc.entity.Result;
import cn.yzc.server.OrdersServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>Project: SpringColud - OrdersController</p>
 * <p>Powered by yzc On 2024-01-05 17:53:27</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@RestController
public class OrdersController {
    @Autowired
    OrdersServer ordersServer;

    @PostMapping("save")
    public Result save(@RequestBody Orders orders){
        int rs = ordersServer.insert(orders);
        if (rs==0)
            return Result.error("生成订单失败");
        return Result.success("生成订单成功");
    }
}
